class StatusError(Exception):
    def __init__(self,
                 err,
                 msg=None):
        self.err = err
        self.msg = msg
        
    def __str__(self):
        rval = '[StatusError] %s' % self.err
        if self.msg:
            rval += ': %s' % self.msg
        return rval

class ReadOnlyException(Exception):
    def __init__(self, msg=None):
        self.msg = msg

    def __str__(self):
        rval = '[ReadOnlyException]'

        if self.msg:
            rval += ': %s' % self.msg

        return rval

class TransactionError(Exception):
    def __init__(self, msg=None):
        self.msg = msg

    def __str__(self):
        rval = '[TransactionError]'

        if self.msg:
            rval += ': %s' % self.msg

        return rval
